﻿using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using Padsurface.App.Tests.Unit.Stubs;

namespace Padsurface.App.Tests.Unit.ViewModels.PadViewModelSpecifications
{
    public abstract class WhenAddSound : PadViewModelTestBase
    {
        protected override void Act()
        {
            ViewModel.AddSoundCommand.Execute(null);
        }
    }

    [TestClass]
    public class WhenAddSoundGivenFilePickerIsCancelled : WhenAddSound
    {
        protected override void Arrange()
        {
            base.Arrange();
            ((FilePickerStub)FilePicker).PickSingleWaveFileAsyncResult = null;
        }

        [TestMethod]
        public void ThenNoSoundShouldBeAdded()
        {
            Assert.AreEqual(0, ViewModel.Sounds.Count);
        }
    }
}